<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>用户详情 - 兴趣交友</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #3b82f6;
            --primary-light: #93c5fd;
            --primary-dark: #1d4ed8;
            --secondary: #10b981;
            --accent: #f97316;
            --danger: #ef4444;
            --text-primary: #1f2937;
            --text-secondary: #6b7280;
            --text-light: #9ca3af;
            --bg-light: #f3f4f6;
            --bg-white: #ffffff;
            --border-light: #e5e7eb;
            --radius: 12px;
            --shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 55px;
            padding-bottom: 70px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 55px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 15px;
            z-index: 1000;
            border-bottom: 1px solid var(--border-light);
            box-shadow: var(--shadow);
        }
        
        .nav-title {
            font-size: 1.15rem;
            font-weight: 600;
            color: var(--primary-dark);
        }
        
        .nav-action {
            color: var(--text-secondary);
            background: none;
            border: none;
            font-size: 1.2rem;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .nav-action:hover {
            background-color: var(--bg-light);
        }
        
        /* 个人资料头部 */
        .profile-header {
            background-color: var(--bg-white);
            padding-bottom: 20px;
        }
        
        .cover-photo {
            width: 100%;
            height: 160px;
            object-fit: cover;
        }
        
        .avatar-container {
            display: flex;
            justify-content: center;
            margin-top: -50px;
        }
        
        .profile-avatar {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            object-fit: cover;
            border: 4px solid var(--bg-white);
        }
        
        .profile-info {
            text-align: center;
            padding: 0 15px;
        }
        
        .profile-name {
            font-size: 1.4rem;
            font-weight: 600;
            margin-bottom: 5px;
        }
        
        .profile-basics {
            color: var(--text-secondary);
            font-size: 0.9rem;
            margin-bottom: 10px;
            display: flex;
            justify-content: center;
            gap: 15px;
            flex-wrap: wrap;
        }
        
        .online-indicator {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background-color: var(--secondary);
            margin-right: 4px;
        }
        
        .profile-bio {
            font-size: 0.95rem;
            line-height: 1.5;
            padding: 0 15px;
            margin-bottom: 15px;
        }
        
        /* 操作按钮组 */
        .action-buttons {
            display: flex;
            gap: 10px;
            padding: 0 15px 15px;
        }
        
        .primary-btn {
            flex: 1;
            padding: 12px 0;
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 0.95rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }
        
        .primary-btn:hover {
            background-color: var(--primary-dark);
        }
        
        .secondary-btn {
            flex: 1;
            padding: 12px 0;
            background-color: var(--bg-light);
            color: var(--text-secondary);
            border: 1px solid var(--border-light);
            border-radius: 8px;
            font-size: 0.95rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }
        
        .icon-btn {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            background-color: var(--bg-light);
            color: var(--text-secondary);
            border: 1px solid var(--border-light);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        /* 资料卡片 */
        .profile-cards {
            margin-top: 15px;
        }
        
        .info-card {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            margin-bottom: 15px;
            overflow: hidden;
            box-shadow: var(--shadow);
        }
        
        .card-title {
            font-size: 1rem;
            font-weight: 600;
            padding: 15px;
            border-bottom: 1px solid var(--border-light);
        }
        
        .card-content {
            padding: 15px;
        }
        
        /* 兴趣标签 */
        .interests-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .interest-tag {
            background-color: rgba(59, 130, 246, 0.1);
            color: var(--primary);
            font-size: 0.85rem;
            padding: 5px 12px;
            border-radius: 20px;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .interest-tag i {
            font-size: 0.75rem;
        }
        
        /* 照片墙 */
        .photos-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 3px;
        }
        
        .photo-item {
            aspect-ratio: 1/1;
            overflow: hidden;
        }
        
        .photo-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease;
        }
        
        .photo-item img:hover {
            transform: scale(1.05);
        }
        
        .more-photos {
            position: relative;
        }
        
        .photo-count {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
        }
        
        /* 详细信息列表 */
        .detail-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        
        .detail-item {
            padding: 12px 0;
            border-bottom: 1px solid var(--border-light);
            display: flex;
            align-items: center;
        }
        
        .detail-item:last-child {
            border-bottom: none;
        }
        
        .detail-icon {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background-color: rgba(59, 130, 246, 0.1);
            color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 12px;
            flex-shrink: 0;
        }
        
        .detail-info {
            flex: 1;
        }
        
        .detail-label {
            font-size: 0.85rem;
            color: var(--text-secondary);
            margin-bottom: 3px;
        }
        
        .detail-value {
            font-size: 0.95rem;
            color: var(--text-primary);
        }
        
        /* 留言板 */
        .message-board {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            margin-bottom: 80px;
            box-shadow: var(--shadow);
        }
        
        .message-input-container {
            padding: 15px;
            border-top: 1px solid var(--border-light);
            position: relative;
        }
        
        .message-input {
            width: 100%;
            padding: 12px 15px;
            border-radius: 25px;
            border: 1px solid var(--border-light);
            background-color: var(--bg-light);
            font-size: 0.9rem;
            resize: none;
            height: 50px;
            overflow: hidden;
        }
        
        .message-input:focus {
            outline: none;
            border-color: var(--primary-light);
        }
        
        .send-btn {
            position: absolute;
            right: 25px;
            bottom: 25px;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background-color: var(--primary);
            color: white;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        /* 留言列表 */
        .messages-list {
            max-height: 400px;
            overflow-y: auto;
        }
        
        .message-item {
            padding: 15px;
            border-bottom: 1px solid var(--border-light);
            display: flex;
            gap: 10px;
        }
        
        .message-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
        }
        
        .message-content {
            flex: 1;
        }
        
        .message-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 5px;
        }
        
        .message-sender {
            font-size: 0.9rem;
            font-weight: 500;
        }
        
        .message-time {
            font-size: 0.75rem;
            color: var(--text-secondary);
        }
        
        .message-text {
            font-size: 0.9rem;
            line-height: 1.4;
            margin-bottom: 8px;
        }
        
        .message-actions {
            display: flex;
            gap: 15px;
            font-size: 0.8rem;
        }
        
        .message-action {
            color: var(--text-secondary);
            background: none;
            border: none;
            display: flex;
            align-items: center;
            gap: 3px;
        }
        
        .message-action:hover {
            color: var(--primary);
        }
        
        /* 回复区域 */
        .replies-container {
            margin-top: 10px;
            padding-left: 15px;
            border-left: 2px solid var(--border-light);
        }
        
        .reply-item {
            margin-bottom: 10px;
            padding: 8px 10px;
            background-color: var(--bg-light);
            border-radius: 8px;
        }
        
        .reply-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 5px;
            font-size: 0.8rem;
        }
        
        .reply-sender {
            font-weight: 500;
        }
        
        .reply-text {
            font-size: 0.85rem;
            line-height: 1.4;
        }
        
        .reply-form {
            margin-top: 10px;
            display: flex;
            gap: 8px;
        }
        
        .reply-input {
            flex: 1;
            padding: 6px 12px;
            border-radius: 15px;
            border: 1px solid var(--border-light);
            font-size: 0.85rem;
        }
        
        .reply-send {
            padding: 6px 12px;
            border-radius: 15px;
            background-color: var(--primary);
            color: white;
            border: none;
            font-size: 0.85rem;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 65px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
            text-decoration: none;
        }
        
        .nav-item i {
            font-size: 1.3rem;
            margin-bottom: 3px;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        /* 提示消息 */
        .toast-notification {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            z-index: 9999;
            font-size: 0.9rem;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast-notification.show {
            opacity: 1;
        }
        
        /* 空状态 */
        .empty-state {
            padding: 40px 20px;
            text-align: center;
            color: var(--text-secondary);
        }
        
        .empty-icon {
            font-size: 3rem;
            margin-bottom: 15px;
            color: var(--text-light);
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-action" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">用户详情</div>
        <button class="nav-action" id="moreOptions">
            <i class="fas fa-ellipsis-h"></i>
        </button>
    </div>
    
    <!-- 个人资料头部 -->
    <div class="profile-header">
        <img src="https://picsum.photos/id/1048/800/400" alt="封面照片" class="cover-photo">
        
        <div class="avatar-container">
            <img src="https://picsum.photos/id/64/200/200" alt="用户头像" class="profile-avatar">
        </div>
        
        <div class="profile-info">
            <h1 class="profile-name">音乐旅人</h1>
            
            <div class="profile-basics">
                <span><span class="online-indicator"></span>在线</span>
                <span>28岁</span>
                <span>男</span>
                <span><i class="fas fa-map-marker-alt"></i> 5.2公里</span>
            </div>
            
            <p class="profile-bio">
                热爱独立音乐和城市探索，周末常去livehouse和咖啡馆。最近在学习吉他，希望找到能一起交流音乐的朋友。
            </p>
            
            <div class="action-buttons">
                <button class="primary-btn" id="chatBtn">
                    <i class="fas fa-comment"></i> 聊天
                </button>
                <button class="secondary-btn" id="followBtn">
                    <i class="far fa-plus-square"></i> 关注
                </button>
                <button class="icon-btn" id="shareBtn">
                    <i class="fas fa-share-alt"></i>
                </button>
            </div>
        </div>
    </div>
    
    <!-- 资料卡片区域 -->
    <div class="profile-cards">
        <!-- 兴趣爱好 -->
        <div class="info-card">
            <div class="card-title">
                <i class="fas fa-heart text-primary me-2"></i>兴趣爱好
            </div>
            <div class="card-content">
                <div class="interests-list">
                    <span class="interest-tag">
                        <i class="fas fa-music"></i> 独立音乐
                    </span>
                    <span class="interest-tag">
                        <i class="fas fa-camera"></i> 摄影
                    </span>
                    <span class="interest-tag">
                        <i class="fas fa-plane"></i> 旅行
                    </span>
                    <span class="interest-tag">
                        <i class="fas fa-guitar"></i> 吉他
                    </span>
                    <span class="interest-tag">
                        <i class="fas fa-coffee"></i> 咖啡馆探店
                    </span>
                    <span class="interest-tag">
                        <i class="fas fa-film"></i> 独立电影
                    </span>
                </div>
            </div>
        </div>
        
        <!-- 照片墙 -->
        <div class="info-card">
            <div class="card-title">
                <i class="fas fa-images text-primary me-2"></i>照片墙
            </div>
            <div class="card-content">
                <div class="photos-grid">
                    <div class="photo-item">
                        <img src="https://picsum.photos/id/1068/300/300" alt="照片1">
                    </div>
                    <div class="photo-item">
                        <img src="https://picsum.photos/id/1059/300/300" alt="照片2">
                    </div>
                    <div class="photo-item more-photos">
                        <img src="https://picsum.photos/id/1073/300/300" alt="更多照片">
                        <div class="photo-count">+8</div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 个人详情 -->
        <div class="info-card">
            <div class="card-title">
                <i class="fas fa-info-circle text-primary me-2"></i>个人详情
            </div>
            <div class="card-content">
                <ul class="detail-list">
                    <li class="detail-item">
                        <div class="detail-icon">
                            <i class="fas fa-birthday-cake"></i>
                        </div>
                        <div class="detail-info">
                            <div class="detail-label">生日</div>
                            <div class="detail-value">1995年6月12日</div>
                        </div>
                    </li>
                    <li class="detail-item">
                        <div class="detail-icon">
                            <i class="fas fa-graduation-cap"></i>
                        </div>
                        <div class="detail-info">
                            <div class="detail-label">学历</div>
                            <div class="detail-value">本科</div>
                        </div>
                    </li>
                    <li class="detail-item">
                        <div class="detail-icon">
                            <i class="fas fa-briefcase"></i>
                        </div>
                        <div class="detail-info">
                            <div class="detail-label">职业</div>
                            <div class="detail-value">音乐制作人</div>
                        </div>
                    </li>
                    <li class="detail-item">
                        <div class="detail-icon">
                            <i class="fas fa-venus-mars"></i>
                        </div>
                        <div class="detail-info">
                            <div class="detail-label">感情状态</div>
                            <div class="detail-value">单身</div>
                        </div>
                    </li>
                    <li class="detail-item">
                        <div class="detail-icon">
                            <i class="fas fa-language"></i>
                        </div>
                        <div class="detail-info">
                            <div class="detail-label">语言</div>
                            <div class="detail-value">中文、英语</div>
                        </div>
                    </li>
                    <li class="detail-item">
                        <div class="detail-icon">
                            <i class="fas fa-calendar-check"></i>
                        </div>
                        <div class="detail-info">
                            <div class="detail-label">加入时间</div>
                            <div class="detail-value">2023年3月</div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
        
        <!-- 留言板 -->
        <div class="message-board">
            <div class="card-title">
                <i class="fas fa-comments text-primary me-2"></i>留言板
            </div>
            
            <div class="messages-list">
                <!-- 留言1 -->
                <div class="message-item">
                    <img src="https://picsum.photos/id/26/100/100" alt="用户头像" class="message-avatar">
                    <div class="message-content">
                        <div class="message-header">
                            <span class="message-sender">户外探险家</span>
                            <span class="message-time">3天前</span>
                        </div>
                        <div class="message-text">
                            看到你分享的音乐节照片，非常棒！我也很喜欢那个乐队，下次有演出可以一起去。
                        </div>
                        <div class="message-actions">
                            <button class="message-action reply-btn">
                                <i class="fas fa-reply"></i> 回复
                            </button>
                            <button class="message-action like-btn">
                                <i class="far fa-heart"></i> 点赞 (5)
                            </button>
                        </div>
                        
                        <!-- 回复区域 -->
                        <div class="replies-container">
                            <div class="reply-item">
                                <div class="reply-header">
                                    <span class="reply-sender">音乐旅人</span>
                                    <span class="message-time">2天前</span>
                                </div>
                                <div class="reply-text">
                                    好啊！他们下个月还有一场演出，我已经买好票了，可以一起去~
                                </div>
                            </div>
                        </div>
                        
                        <!-- 回复表单 (默认隐藏) -->
                        <div class="reply-form" style="display: none;">
                            <input type="text" class="reply-input" placeholder="写下你的回复...">
                            <button class="reply-send">发送</button>
                        </div>
                    </div>
                </div>
                
                <!-- 留言2 -->
                <div class="message-item">
                    <img src="https://picsum.photos/id/91/100/100" alt="用户头像" class="message-avatar">
                    <div class="message-content">
                        <div class="message-header">
                            <span class="message-sender">书虫一枚</span>
                            <span class="message-time">1周前</span>
                        </div>
                        <div class="message-text">
                            你推荐的那本关于独立音乐历史的书我看完了，收获很大，谢谢分享！
                        </div>
                        <div class="message-actions">
                            <button class="message-action reply-btn">
                                <i class="fas fa-reply"></i> 回复
                            </button>
                            <button class="message-action like-btn">
                                <i class="far fa-heart"></i> 点赞 (3)
                            </button>
                        </div>
                        
                        <!-- 回复表单 (默认隐藏) -->
                        <div class="reply-form" style="display: none;">
                            <input type="text" class="reply-input" placeholder="写下你的回复...">
                            <button class="reply-send">发送</button>
                        </div>
                    </div>
                </div>
                
                <!-- 留言3 -->
                <div class="message-item">
                    <img src="https://picsum.photos/id/65/100/100" alt="用户头像" class="message-avatar">
                    <div class="message-content">
                        <div class="message-header">
                            <span class="message-sender">咖啡爱好者</span>
                            <span class="message-time">2周前</span>
                        </div>
                        <div class="message-text">
                            看到你分享的几家咖啡馆，周末去了其中一家，环境真的很不错，谢谢你的推荐！
                        </div>
                        <div class="message-actions">
                            <button class="message-action reply-btn">
                                <i class="fas fa-reply"></i> 回复
                            </button>
                            <button class="message-action like-btn">
                                <i class="far fa-heart"></i> 点赞 (8)
                            </button>
                        </div>
                        
                        <!-- 回复表单 (默认隐藏) -->
                        <div class="reply-form" style="display: none;">
                            <input type="text" class="reply-input" placeholder="写下你的回复...">
                            <button class="reply-send">发送</button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 留言输入框 -->
            <div class="message-input-container">
                <textarea class="message-input" placeholder="写下你的留言..."></textarea>
                <button class="send-btn" id="sendMessage">
                    <i class="fas fa-paper-plane"></i>
                </button>
            </div>
        </div>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-users"></i>
            <span>交友</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-compass"></i>
            <span>发现</span>
        </a>
        <a href="#" class="nav-item">
            <i class="far fa-user"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // 提示消息
        function showToast(message) {
            // 检查是否已有toast
            let toast = document.querySelector('.toast-notification');
            if (toast) {
                toast.remove();
            }
            
            // 创建新toast
            toast = document.createElement('div');
            toast.className = 'toast-notification';
            toast.textContent = message;
            
            document.body.appendChild(toast);
            
            // 显示toast
            setTimeout(() => {
                toast.classList.add('show');
            }, 10);
            
            // 3秒后隐藏并移除
            setTimeout(() => {
                toast.classList.remove('show');
                setTimeout(() => toast.remove(), 300);
            }, 3000);
        }
        
        // 返回按钮
        document.getElementById('backBtn').addEventListener('click', () => {
            showToast('返回列表页');
            // 实际应用中可以使用history.back()
        });
        
        // 更多选项
        document.getElementById('moreOptions').addEventListener('click', () => {
            showToast('更多操作选项');
        });
        
        // 聊天按钮
        document.getElementById('chatBtn').addEventListener('click', () => {
            showToast('进入与音乐旅人的聊天界面');
        });
        
        // 关注按钮
        let isFollowing = false;
        const followBtn = document.getElementById('followBtn');
        
        followBtn.addEventListener('click', () => {
            isFollowing = !isFollowing;
            
            if (isFollowing) {
                followBtn.innerHTML = '<i class="fas fa-check"></i> 已关注';
                followBtn.style.backgroundColor = 'var(--primary)';
                followBtn.style.color = 'white';
                showToast('已关注音乐旅人');
            } else {
                followBtn.innerHTML = '<i class="far fa-plus-square"></i> 关注';
                followBtn.style.backgroundColor = 'var(--bg-light)';
                followBtn.style.color = 'var(--text-secondary)';
                showToast('已取消关注');
            }
        });
        
        // 分享按钮
        document.getElementById('shareBtn').addEventListener('click', () => {
            showToast('分享成功');
        });
        
        // 发送留言
        document.getElementById('sendMessage').addEventListener('click', () => {
            const messageInput = document.querySelector('.message-input');
            const messageText = messageInput.value.trim();
            
            if (messageText) {
                showToast('留言发送成功');
                messageInput.value = '';
                // 调整输入框高度
                messageInput.style.height = '50px';
                
                // 实际应用中这里会添加新留言到列表
            } else {
                showToast('请输入留言内容');
            }
        });
        
        // 留言输入框自动调整高度
        const messageInput = document.querySelector('.message-input');
        messageInput.addEventListener('input', () => {
            // 重置高度
            messageInput.style.height = 'auto';
            // 设置新高度（最小50px，最大120px）
            const newHeight = Math.min(messageInput.scrollHeight, 120);
            messageInput.style.height = newHeight + 'px';
        });
        
        // 回复按钮
        document.querySelectorAll('.reply-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                // 找到对应的回复表单
                const replyForm = this.closest('.message-content').querySelector('.reply-form');
                
                // 隐藏所有回复表单
                document.querySelectorAll('.reply-form').forEach(form => {
                    if (form !== replyForm) {
                        form.style.display = 'none';
                    }
                });
                
                // 切换当前回复表单的显示状态
                replyForm.style.display = replyForm.style.display === 'flex' ? 'none' : 'flex';
                
                // 如果显示，则聚焦输入框
                if (replyForm.style.display === 'flex') {
                    replyForm.querySelector('.reply-input').focus();
                }
            });
        });
        
        // 发送回复
        document.querySelectorAll('.reply-send').forEach(btn => {
            btn.addEventListener('click', function() {
                const replyInput = this.previousElementSibling;
                const replyText = replyInput.value.trim();
                
                if (replyText) {
                    const replyForm = this.closest('.reply-form');
                    const repliesContainer = replyForm.previousElementSibling;
                    
                    // 创建新回复元素
                    const newReply = document.createElement('div');
                    newReply.className = 'reply-item';
                    newReply.innerHTML = `
                        <div class="reply-header">
                            <span class="reply-sender">我</span>
                            <span class="message-time">刚刚</span>
                        </div>
                        <div class="reply-text">
                            ${replyText}
                        </div>
                    `;
                    
                    // 添加到回复容器
                    if (repliesContainer && repliesContainer.classList.contains('replies-container')) {
                        repliesContainer.appendChild(newReply);
                    } else {
                        // 如果没有回复容器，则创建一个
                        const newRepliesContainer = document.createElement('div');
                        newRepliesContainer.className = 'replies-container';
                        newRepliesContainer.appendChild(newReply);
                        replyForm.parentNode.insertBefore(newRepliesContainer, replyForm);
                    }
                    
                    // 清空输入框并隐藏表单
                    replyInput.value = '';
                    replyForm.style.display = 'none';
                    
                    showToast('回复成功');
                } else {
                    showToast('请输入回复内容');
                }
            });
        });
        
        // 点赞按钮
        document.querySelectorAll('.like-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                const icon = this.querySelector('i');
                const isLiked = icon.classList.contains('fas');
                
                if (isLiked) {
                    // 取消点赞
                    icon.classList.remove('fas', 'text-primary');
                    icon.classList.add('far');
                    
                    // 更新点赞数
                    let countText = this.textContent.trim();
                    let count = parseInt(countText.match(/\d+/)[0]);
                    this.innerHTML = `<i class="far fa-heart"></i> 点赞 (${count - 1})`;
                    
                    showToast('已取消点赞');
                } else {
                    // 点赞
                    icon.classList.remove('far');
                    icon.classList.add('fas', 'text-primary');
                    
                    // 更新点赞数
                    let countText = this.textContent.trim();
                    let count = parseInt(countText.match(/\d+/)[0]);
                    this.innerHTML = `<i class="fas fa-heart text-primary"></i> 点赞 (${count + 1})`;
                    
                    showToast('点赞成功');
                }
            });
        });
        
        // 照片点击放大预览（模拟）
        document.querySelectorAll('.photo-item img').forEach(img => {
            img.addEventListener('click', function() {
                showToast('照片预览功能');
            });
        });
        
        // 页面加载完成后初始化
        window.addEventListener('DOMContentLoaded', () => {
            // 滚动到底部时加载更多留言
            const messagesList = document.querySelector('.messages-list');
            messagesList.addEventListener('scroll', () => {
                if (messagesList.scrollTop === 0) {
                    // 这里可以实现加载更多历史留言
                    console.log('加载更多留言');
                }
            });
        });
    </script>
</body>
</html>

